<html>
<head>
<style>
</style>
<script type="text/tiscript">
  include library "tiscript-sqlite";

  // returns current record as an object: 
  property Recordset.record(v)
  {
    get
    {
      var obj = {};
      for( var n in this.length ) 
        obj[this.name(n)] = this[n];
      return obj;
    }
  }

  event click $(#test) ()
  {
    var db = DB.open(":memory:");
    db.exec("create table employee (firstName text, secondName text)" );
    db.exec("insert into employee values ('abcd','efgh')" );
    var rs = db.exec("SELECT firstName, secondName FROM employee");
    
    // Three ways of gettting the same field's value 
    view.msgbox(rs["firstName"]);
    view.msgbox(rs#firstName);
    var rec = rs.record;
    view.msgbox(rec.firstName);
    db.close();
  }
</script>
</head>
<body>
  <button #test>Test it</button>
</body>
</html>